trinomials in a quadratic form